import {
  list
} from '../../../api/askfor';
const util = require('../../../utils/util.js')
let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pageNum: 0,
    pageSize: 10,
    orderList: [],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.loadList()
  },
  loadList() {
    var _this = this
    list({
      pageNum: _this.data.pageNum,
      pageSize: _this.data.pageSize,
      mchId: app.globalData.mchId
    }).then(
      res => {
        console.log(res)
        if (res.type == 'success') {
          _this.data.orderList = res.data.data
          _this.setData({
            orderList: _this.data.orderList,
          })
        }
        console.log(_this.data.orderList)
      }
    ).catch(error => {
      console.log(error)
    })
  }
})